{#
 # ---------------------------------------------------------------------
 #
 # GLPI - Gestionnaire Libre de Parc Informatique
 #
 # http://glpi-project.org
 #
 # @copyright 2015-2024 Teclib' and contributors.
 # @copyright 2003-2014 by the INDEPNET Development Team.
 # @licence   https://www.gnu.org/licenses/gpl-3.0.html
 #
 # ---------------------------------------------------------------------
 #
 # LICENSE
 #
 # This file is part of GLPI.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #
 # ---------------------------------------------------------------------
 #}

{% extends "generic_show_form.html.twig" %}
{% import 'components/form/fields_macros.html.twig' as fields %}
{% set params  = params ?? [] %}

{# TODO Fields can be consolidated more in GLPI 10.1. They currently match the old display. #}
{% block form_fields %}
   {% block more_fields %}
      {{ fields.autoNameField(
         'phonenumber',
         item,
         'Phone'|itemtype_name,
      ) }}

      {{ fields.autoNameField(
         'registration_number',
         item,
         _x('infocom', 'Administrative number'),
      ) }}

      {{ fields.autoNameField(
         'fax',
         item,
         __('Fax'),
      ) }}
      {{ fields.nullField() }}

      {{ fields.autoNameField(
         'website',
         item,
         __('Website'),
      ) }}
      {{ fields.nullField() }}

      {{ fields.autoNameField(
         'email',
         item,
         _n('Email', 'Emails', 1),
      ) }}
      {{ fields.nullField() }}

      {{ fields.autoNameField(
         'postalcode',
         item,
         __('Postal code'),
      ) }}

      {{ fields.textareaField('address', item.fields['address'], __('Address')) }}

      {{ fields.autoNameField(
         'town',
         item,
         __('City'),
      ) }}
      {{ fields.nullField() }}

      {{ fields.autoNameField(
         'state',
         item,
         _x('location', 'State'),
      ) }}
      {{ fields.nullField() }}

      {{ fields.autoNameField(
         'country',
         item,
         __('Country'),
      ) }}
      {{ fields.nullField() }}

      {% set setlocation %}
         {{ item.displaySpecificTypeField(entity.fields['id'], {
            name: 'setlocation',
            type: 'setlocation',
            label: '',
            list: false
         }) }}
      {% endset %}
      {{ fields.htmlField('setlocation', setlocation, __('Location on map')) }}
      {{ fields.nullField() }}

      {{ fields.textField('longitude', item.fields['longitude'], _x('location', 'Longitude')) }}
      {{ fields.nullField() }}
      {{ fields.textField('latitude', item.fields['latitude'], _x('location', 'Latitude')) }}
      {{ fields.nullField() }}
      {{ fields.textField('altitude', item.fields['altitude'], _x('location', 'Altitude')) }}
      {{ fields.nullField() }}
   {% endblock %}
{% endblock %}
